﻿
using Foothill.Common;
using Foothill.DataAccess.Repository;
using Foothill.DataAccess.Interface;

namespace Foothill.Service.SystemMessage
{
    public class SystemMessageService : ISystemMessageService
    {
        private ISystemMessageRepo _sysMessageRepo;

        public SystemMessageService(ISystemMessageRepo sysMessageRepo)
        {
            _sysMessageRepo = sysMessageRepo;  
        }

        public string GetSystemMessage(string msgCode, CultureCode culture)
        {
            return _sysMessageRepo.GetSystemMessage(SystemMessageCategory.Web, msgCode, (int)culture);
        }

        public string GetSystemMessage(SystemMessageCategory category, string msgCode, CultureCode culture)
        {
            return _sysMessageRepo.GetSystemMessage(category, msgCode, (int)culture);
        }

        public string GetSystemMessage(SystemMessageCategory category, string msgCode)
        {
            // todo: get current culture
            CultureCode culture = CultureCode.ZH_CN;
            return _sysMessageRepo.GetSystemMessage(category, msgCode, (int)culture);
        }
    }
}
